import { Entity } from "../../../../../Core/Module/Entity/Entity";
import { IAwake, IAwake1 } from "../../../../../Core/Module/EventSystem/IAwakeSystem";
import { IDestroy } from "../../../../../Core/Module/EventSystem/IDestroySystem";
import { EventStruct } from "../../../../../Core/Module/EventSystem/IEvent";
import { InstanceIdStruct } from "../../../../../Core/Module/IdGenerater/IdGenerater";
import { Options } from "../../../../../Core/Module/Options/Options";
import { ImplementsInterface } from "../../../../../Decorator/Decorator";

export class ProcessActorId {
    public Process: number;
    public ActorId: number;

    constructor(actorId: number) {
        let instanceIdStruct = InstanceIdStruct.Create(actorId);
        this.Process = instanceIdStruct.Process;
        instanceIdStruct.Process = Options.Instance.Process;
        this.ActorId = instanceIdStruct.ToLong();
    }
}

export class NetInnerComponentOnRead extends EventStruct {
    public ActorId: number;
    public Message: Object;
}

@ImplementsInterface(IAwake1)
@ImplementsInterface(IAwake)
@ImplementsInterface(IDestroy)
export class NetInnerComponent extends Entity implements IAwake1<string>, IAwake, IDestroy {

    public ServiceId: number;

    public static Instance: NetInnerComponent;

}